<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

require_once("Utils.class.php");
require_once("Connection.class.php");
require_once("StatementsEngine.class.php");


$case = isset($_POST['case'])?$_POST['case']:'';

switch ($case){
    
    case 'cep':
        
        $cep = $_POST['cep'];
        $endereco = StatementsEngine::getEnderecoCep($cep);
        $endereco_encode = Utils::utf8_encode_array($endereco[0]);
        echo json_encode($endereco_encode); 
    
    break;    
}
?>
